
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>1. php 开发环境安装 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="2.html" />
    
    
    <link rel="prev" href="../" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        <li class="header">内容</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    0. 介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2" data-path="1.html">
            
                <a href="1.html">
            
                    
                    1. php 开发环境安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="2.html">
            
                <a href="2.html">
            
                    
                    2. 跑 laravel 的 hello world
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="3.html">
            
                <a href="3.html">
            
                    
                    3. 第一个路由 UsersController
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="4.html">
            
                <a href="4.html">
            
                    
                    4. 在数据库中创建一条数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="5.html">
            
                <a href="5.html">
            
                    
                    5. 简单的用户认证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="6.html">
            
                <a href="6.html">
            
                    
                    6. 修改 User model
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="7.html">
            
                <a href="7.html">
            
                    
                    7. User model 的 getter 方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="8.html">
            
                <a href="8.html">
            
                    
                    8. view 的更多知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="9.html">
            
                <a href="9.html">
            
                    
                    9. 在 view 中共享变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="10.html">
            
                <a href="10.html">
            
                    
                    10. blade layout
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="11.html">
            
                <a href="11.html">
            
                    
                    11. 使用 @include 来整理 view
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="12.html">
            
                <a href="12.html">
            
                    
                    12. Blade if/else/unless/or
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="13.html">
            
                <a href="13.html">
            
                    
                    13. factories, faker and seeding
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="14.html">
            
                <a href="14.html">
            
                    
                    14. Blade foreach
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">其他</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="laravel_vim.html">
            
                <a href="laravel_vim.html">
            
                    
                    VIM 的 laravel 插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="laravel_code_vim.html">
            
                <a href="laravel_code_vim.html">
            
                    
                    VIM 中有效地查看 php 源码
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >1. php 开发环境安装</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x6211;&#x662F;&#x4E00;&#x540D;ruby on rails&#x7A0B;&#x5E8F;&#x5458;&#xFF0C;&#x60F3;&#x5B66;&#x4E60;&#x4E00;&#x4E0B;laravel&#x8FD9;&#x4E2A;php&#x7684;web mvc&#x6846;&#x67B6;&#x3002;</p>
<p>&#x6211;&#x624B;&#x5934;&#x4E0A;&#x6709;&#x4E00;&#x53F0;macbook&#x3002;</p>
<p>&#x6211;&#x73B0;&#x5728;&#x628A;&#x8FD9;&#x4E2A;&#x5B66;&#x4E60;&#x8FC7;&#x7A0B;&#x8BB0;&#x5F55;&#x4E0B;&#x6765;&#x3002;</p>
<p>&#x9996;&#x5148;&#x662F;&#x5B89;&#x88C5;&#x73AF;&#x5883;&#xFF0C;&#x8981;&#x5148;&#x4F7F;&#x7528;laravel&#x6846;&#x67B6;&#x4E4B;&#x524D;&#xFF0C;&#x5FC5;&#x987B;&#x8981;&#x5148;&#x5B89;&#x88C5;php&#x7684;&#x5F00;&#x53D1;&#x73AF;&#x5883;&#x3002;</p>
<h4 id="1-&#x5B89;&#x88C5;php">1. &#x5B89;&#x88C5;php</h4>
<p>&#x5B89;&#x88C5;&#x7684;php&#x7248;&#x672C;&#x6700;&#x597D;&#x5C31;&#x662F;7&#x4EE5;&#x4E0A;&#x5427;&#xFF0C;&#x6211;&#x662F;&#x7528;homebrew&#x6765;&#x5B89;&#x88C5;&#x7684;&#x3002;</p>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x7528;&#x4EE5;&#x4E0B;&#x7684;&#x547D;&#x4EE4;&#x6765;&#x641C;&#x7D22;&#x4E00;&#x4E0B;&#x53EF;&#x4EE5;&#x5B89;&#x88C5;&#x7684;php&#x7248;&#x672C;&#x3002;</p>
<pre><code class="lang-bash">brew search php
</code></pre>
<p>&#x6700;&#x540E;&#x6211;&#x7528;&#x4E0B;&#x9762;&#x8FD9;&#x6761;&#x547D;&#x4EE4;&#x6765;&#x5B89;&#x88C5;php71&#x3002;</p>
<pre><code class="lang-bash">brew install homebrew/php/php71
</code></pre>
<p><img src="https://rails365.oss-cn-shenzhen.aliyuncs.com/uploads/photo/image/270/2017/0ee621b4fb8c51c9bfe971e0da4048da.png" alt=""></p>
<h4 id="2-&#x5B89;&#x88C5;composer">2. &#x5B89;&#x88C5;composer</h4>
<p>composer&#x662F;php&#x754C;&#x7528;&#x6765;&#x7BA1;&#x7406;&#x5305;&#x7684;&#xFF0C;&#x76F8;&#x5F53;&#x4E8E;ruby&#x4E2D;&#x7684;gem&#x3002;</p>
<p>&#x5728;mac&#x4E0B;&#x5B89;&#x88C5;composer&#x4E5F;&#x86EE;&#x7B80;&#x5355;&#x7684;&#xFF0C;&#x53EA;&#x8981;&#x4E00;&#x6761;&#x547D;&#x4EE4;&#x5373;&#x53EF;&#x3002;</p>
<pre><code>brew install composer
</code></pre><p>&#x5982;&#x679C;&#x4E0D;&#x662F;&#x5728;mac&#x4E0B;&#x5B89;&#x88C5;&#xFF0C;&#x90A3;&#x5E94;&#x8BE5;&#x8981;&#x5230;composer&#x7684;&#x5B98;&#x7F51;&#x53BB;&#x4E0B;&#x8F7D;composer&#x7684;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#xFF0C;&#x5BB9;&#x6613;&#x653E;&#x5230;$PATH&#x4E2D;&#x3002;</p>
<p><a href="https://getcomposer.org/download/" target="_blank">https://getcomposer.org/download/</a></p>
<blockquote>
<p>&#x6211;&#x4E4B;&#x524D;&#x5728;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x5C31;&#x662F;&#x8FD9;&#x4E48;&#x505A;&#x7684;&#xFF0C;&#x56E0;&#x4E3A;&#x7531;&#x4E8E;&#x7F51;&#x901F;&#x7B49;&#x539F;&#x56E0;&#x4E0B;&#x8F7D;&#x4E0B;&#x6765;&#x597D;&#x6162;&#xFF0C;&#x6211;&#x5C31;&#x628A;composer&#x7684;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x7528;&#x6D4F;&#x89C8;&#x5668;&#x4E0B;&#x8F7D;&#x5B8C;&#xFF0C;&#x7136;&#x540E;scp&#x5230;&#x670D;&#x52A1;&#x5668;&#x4E2D;&#x3002;</p>
</blockquote>
<pre><code class="lang-bash">sudo mv composer.phar /usr/<span class="hljs-built_in">local</span>/bin/composer
sudo chmod u+x /usr/<span class="hljs-built_in">local</span>/bin/composer
</code></pre>
<p><img src="https://rails365.oss-cn-shenzhen.aliyuncs.com/uploads/photo/image/269/2017/aa3cfeb584ec83c3e11676066c3e8b37.png" alt=""></p>
<h4 id="3-&#x914D;&#x7F6E;composer&#x4E2D;&#x56FD;&#x955C;&#x50CF;">3. &#x914D;&#x7F6E;composer&#x4E2D;&#x56FD;&#x955C;&#x50CF;</h4>
<p>&#x8FD9;&#x4E2A;&#x8DDF;ruby&#x7684;gem&#x4E5F;&#x662F;&#x6709;&#x70B9;&#x50CF;&#xFF0C;&#x5728;&#x56FD;&#x5185;&#x5B89;&#x88C5;composer&#x5305;&#x4E5F;&#x662F;&#x5F88;&#x6162;&#xFF0C;&#x6240;&#x4EE5;&#x6709;&#x4E86;&#x4E2D;&#x56FD;&#x955C;&#x50CF;&#x6E90;&#x3002;</p>
<p><a href="https://pkg.phpcomposer.com/" target="_blank">https://pkg.phpcomposer.com/</a></p>
<p>&#x4F7F;&#x7528;&#x4E0B;&#x9762;&#x7684;&#x547D;&#x4EE4;&#x5373;&#x53EF;&#x3002;</p>
<pre><code>composer config -g repo.packagist composer https://packagist.phpcomposer.com
</code></pre><p>&#x8FD9;&#x6837;&#xFF0C;&#x6574;&#x4E2A;php&#x5F00;&#x53D1;&#x73AF;&#x5883;&#x642D;&#x5EFA;&#x5B8C;&#x6BD5;&#x3002;</p>
<p>&#x5B8C;&#x7ED3;&#x3002;</p>
<p>&#x4E0B;&#x4E00;&#x7BC7;&#xFF1A;<a href="https://www.rails365.net/articles/ruby-cheng-xu-yuan-xue-xi-laravel-kuang-jia-bi-ji-2-pao-laravel-de-hello-world" target="_blank">Ruby &#x7A0B;&#x5E8F;&#x5458;&#x5B66;&#x4E60; laravel &#x6846;&#x67B6;&#x7B14;&#x8BB0; (2)-&#x8DD1; laravel &#x7684; hello world</a></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../" class="navigation navigation-prev " aria-label="Previous page: 0. 介绍">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="2.html" class="navigation navigation-next " aria-label="Next page: 2. 跑 laravel 的 hello world">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"1. php 开发环境安装","level":"1.2","depth":1,"next":{"title":"2. 跑 laravel 的 hello world","level":"1.3","depth":1,"path":"chapters/2.md","ref":"chapters/2.md","articles":[]},"previous":{"title":"0. 介绍","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"chapters/1.md","mtime":"2017-09-02T01:52:33.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-09-02T01:57:53.635Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

